import axios, { type AxiosResponse, type InternalAxiosRequestConfig } from 'axios';

// 请求拦截器
axios.interceptors.request.use(
	function (config: InternalAxiosRequestConfig<any>) {
		return config;
	},
	function (error: any) {
		return Promise.reject(error);
	}
);

// 响应拦截器
axios.interceptors.response.use(
	function (response: AxiosResponse<any, any>) {
		return response.data;
	},
	function (error: any) {
		return Promise.reject(error);
	}
);

export default axios;
